package com.test.spring.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.test.spring.service.UserService;


@RestController
public class UserController {
	
	@Autowired
	private UserService userService;
	
	/**
	 * 获取用户列表
	 */
	@RequestMapping(value="/userList",method= RequestMethod.GET)
	public void getUserList() {
		
		userService.getUserList();
		
		}
	
	/**
	 * 更新用户信息
	 */
	@RequestMapping(value="/updUser",method=RequestMethod.POST)
	public void updateUser(@RequestParam("userId") String userId,@RequestParam("userName") String userName){
		try {
			userService.updateUser(userId, userName);
		} catch (Exception e) {
			System.out.println("yichang.............");
			e.printStackTrace();
		}
	}

}
